﻿using JESAI.Redis.Datas;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;

namespace JESAI.Redis.Abstracts.Serializers
{
    internal interface IRedisSerializer
    {
        /// <summary>
        /// 序列化
        /// </summary>
        /// <param name="source"></param>
        /// <returns></returns>
        Task<RedisEncodeData> SerializeAsync(object source);

        /// <summary>
        /// 反序列化
        /// </summary>
        /// <param name="source"></param>
        /// <typeparam name="TResult"></typeparam>
        /// <returns></returns>
        Task<TResult> DeserializeAsync<TResult>(byte[] source);
    }
}
